Repository navigation
Enable ImGui docking + multi-viewport - #791
Merged
Merged
Conversation
Sajeeth-Wimalasuriyan
commented
Apr 21, 2026
Contributor
…heir own OS window
- Turn on ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_ViewportsEnable
after ImGui::CreateContext(), and set ConfigViewportsNoTaskBarIcon so
undocked panels don't spawn taskbar entries
- Add the UpdatePlatformWindows() / RenderPlatformWindowsDefault() pass in
the main render loop (with GL-context backup/restore for the OpenGL
fallback path), and reorder so the main backend present() runs after
the platform-windows pass
- Bump the Vulkan descriptor pool from 100 -> 1024 samplers/sets to give
secondary platform viewports headroom
- Mark "Main Window" NoDocking so Summary can be the only dockable
window for now; drop NoSavedSettings from Summary and seed its
initial pos from GetMainViewport()->WorkPos so it lands inside the
main window even after viewport coords become absolute screen coords
Replace BeginDragDropSource "is-item-being-dragged?" hacks in two resize
bars (track height, sidebar width) with the proper
IsItemActive() && IsMouseDragging() idiom. The old pattern interacted
badly with imgui-docking's internal window-move drag-drop and would
spuriously resize tracks when other windows were being dragged.
Fix the track reorder "is_reordering" check to validate the payload
type. imgui-docking calls BeginDockableDragDropSource() during any
window-move, setting g.DragDropActive=true with a "_IMWINDOW" payload.
The old check only tested GetDragDropPayload() != null, so with
m_reorder_request.track_id defaulting to 0 the first track appeared to
be reordering (rendered as Dummy) every time another window was
dragged. Now we additionally require payload->IsDataType("reorder_request").
Made-with: Cursor
Made-with: Cursor
Sajeeth-Wimalasuriyan
requested review from
a team,
amokiche-amd,
drchen-amd and
tomk-amd
as code owners
April 21, 2026 19:38
This comment was marked as outdated.
This comment was marked as outdated.
Snap secondary viewports to the actual OS window position each frame, then restore the intended drag target before platform window updates. This fixes WM-clamped drag cases on X11/Xwayland where ImGui keeps an off-screen viewport position, causing hover offsets and corner-lock behavior.
… platform helpers files.
Only run hooks on systems running wayland
glfwShowWindow and glfwSetWindowPos each XFlush internally, and the next glfwPollEvents performs a server round-trip, so an explicit XSync() here turned out to be unnecessary in practice -- which lets us avoid linking libX11.
Introduce a command-line option `--drag-repair` to manage a workaround for drag and click-through issues specific to Ubuntu's Wayland compositor. The implementation includes parsing the option and applying the appropriate settings based on user input or environment variables. Update platform helper functions to support this feature, ensuring compatibility across different Linux distributions.
Update the command-line option `--drag-repair` to clarify its functionality and improve user experience. The description now specifies the trade-off of a brief flicker during drag-release and restricts the default setting to 'off'. Additionally, enhance comments in the platform helper files to better explain the underlying bugs and the rationale for user-controlled fixes, ensuring clarity on the conditions under which workarounds are applied.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp # src/app/src/rocprofvis_imgui_vulkan.cpp
- Drop the custom rocprofvis_view_set_dpi API and the GLFW content-scale callback path. The view now relies on ImGui's ConfigDpiScaleFonts / ConfigDpiScaleViewports for per-monitor scaling. - main.cpp enables ImGuiConfigFlags_ViewportsEnable and the DPI flags, sets FontScaleMain = 1.0f, and renders platform windows via UpdatePlatformWindows / RenderPlatformWindowsDefault while preserving the GLFW context for OpenGL. - Replace the font dropdown with a clamped 13-18 pt slider. User settings only persist a base font index; FontManager exposes GetMinUserFontSize / GetMaxUserFontSize / GetFontSizeAt / GetDefaultFontSizeIndex / ClampFontSizeIndex. - Fix FontSize indexing bug: ImGui's default font now uses FontSize::kDefault (the user-chosen base) instead of FontType::kDefault, which had been silently mapping to FontSize::kSmall (base - 1). Added static_asserts to keep kSizeOffsets in lockstep with the FontSize enum. - Drop dpi_based_scaling from DisplaySettings and its JSON key; SettingsManager no longer tracks DPI. Co-authored-by: Cursor <cursoragent@cursor.com>
…caling Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Compute the status bar height as the framed content line plus the child border (FramePadding taken from the default style to match RenderStatusBar) instead of a magic formula, and remove the ImGuiWindowFlags_NoScrollbar bandaid. The previous calculation read the live style and ignored the child border, so the bar could overflow into a scrollbar under ImGui auto-DPI font scaling. Co-authored-by: Cursor <cursoragent@cursor.com>
Re-add the GLFW_SCALE_TO_MONITOR hint to both the initial Vulkan window and the OpenGL-fallback window setup. It was dropped during the DPI cleanup but is still needed for correct per-monitor window scaling. Addresses review feedback. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp
log drag repair state if used
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp # src/view/src/widgets/rocprofvis_gui_helpers.cpp
remove unused functions remove unused headers don't call View namespace objects from main fix summary merge error
Member
tomk-amd
marked this pull request as draft
July 10, 2026 14:41
Collaborator
|
Changing to draft so noone wastes time trying to review this.. Still too unstable.. |
The branch's custom-DPI removal already landed on main as the reviewed PR #892, so the duplicated font/settings/DPI work is dropped in favour of main's version. The branch's own contributions are reapplied on top of main's newer code: - multi-viewport enabled (docking left off) and the Linux/Wayland viewport-position and post-drag click-through workarounds - Linux platform helpers moved into main's RocProfVis::Platform namespace alongside the new macOS helpers - logging initialised before CLI parsing so option diagnostics are captured - internal build banner drawn on the main viewport - track resize bars and the sidebar splitter resize via a plain drag instead of a payload-less drag-drop source, and track reordering now matches on the reorder_request payload type Co-authored-by: Cursor <cursoragent@cursor.com>
io.ConfigDpiScaleViewports rescales a window's position and size whenever its viewport reports a new DPI. Upstream documents this as a resizing feedback loop for a window straddling a DPI boundary, and since the scaling is lossy the geometry drifts instead of round-tripping. The runaway values then persist to imgui.ini and reload on the next launch. Fonts still scale per monitor through ConfigDpiScaleFonts. Also stop re-applying the Minimap size every frame. GetResponsiveWindowSize() always clamps to the main viewport, so a Minimap dragged out into its own OS window was held to the wrong monitor's bounds. Bring rocprofvis_platform_helpers.cpp in line with src/.clang-format. Co-authored-by: Cursor <cursoragent@cursor.com>
Updates the imgui submodule from v1.92.6-docking to v1.92.9b-docking (docking branch, not master, so multi-viewport stays available). Notable fixes for this branch's viewport usage: the implicit Debug window no longer steals mouse input or blocks merging secondary viewports back into the main one (#9254), HasMouseHoveredViewport is set correctly again, and viewport size is correct under Per-Monitor V2 DPI (#8897). 1.92.7 reworked the Vulkan backend to allocate user textures as separate VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE + VK_DESCRIPTOR_TYPE_SAMPLER descriptors instead of a single COMBINED_IMAGE_SAMPLER, and renamed the reserve macro to IMGUI_IMPL_VULKAN_MINIMUM_SAMPLED_IMAGE_POOL_SIZE. The app owns its descriptor pool, so it must supply both descriptor types or ImGui_ImplVulkan_AddTexture() fails at runtime with VK_ERROR_OUT_OF_POOL_MEMORY. The pool now mirrors the layout the backend builds for its own auto-created pool. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
These are pre-existing issues on main that entered the PR diff for this branch through the merge of origin/main, so code scanning attributes them here. - test/main.cpp: %ld printed uint32_t row counts, reading eight bytes for a four-byte argument where long is 64-bit. - compute_summary.cpp, compute_roofline.cpp: %u truncated the uint64_t InvocationCount metric to 32 bits. - topology_model.cpp: GetDevice returns nullptr on a lookup miss but its result was dereferenced without a guard. Co-authored-by: Cursor <cursoragent@cursor.com>
GLFW iconifies a fullscreen window on focus loss, so clicking a panel in its own OS window minimized the whole app. Also fixes F11 being ignored unless the main window had focus, a geometry check that forced fullscreen back off mid-transition, and the window losing one title bar of height on every toggle. Makes --drag-repair a persisted setting (default off), replacing the env var and Wayland auto-detection.
Member
Windows
Screen.Recording.2026-08-31.194906.mp4
From 2160p to 1080p: Screen.Recording.2026-08-31.194319.mp4(I can only record one display at a time, so this is view of 1080p with main app running on 2160p) From 1080p to 2160p: Screen.Recording.2026-08-31.193931.mp4I couldn't test on ubuntu because my system is busy. I did try it there and saw some different weirdness, but I can't rule out interference from my stress test messing with the input. |
Add ROCPROFVIS_MULTI_WINDOW and ROCPROFVIS_ENABLE_TRACE_COMPARE build options, both defaulting OFF, so the in-development features can be excluded from a release build. ViewportsEnable is what every viewport code path on this branch already tests at runtime, so guarding the one line that sets it also disables the Linux drag-repair hooks and the platform-window render pass. The GLFW_AUTO_ICONIFY override and the Linux X11 platform force exist only to support dragged-out panels, so they are guarded by the same flag, which leaves Wayland users on native rendering when multi-window is compiled out. Co-authored-by: Cursor <cursoragent@cursor.com>
tomk-amd
reviewed
Sep 2, 2026
The post-drag click-through workaround only has anything to repair when panels can be dragged into their own OS window, so --drag-repair no longer appears in a build without multi-window support. Gating the option registration alone would leave configure_drag_repair() still reading the persisted setting and pushing it into the platform layer for an option that can no longer be passed, so the whole unit is guarded: the option, the handler and its call site, the two viewport position hooks, and the intended-position map that exists only to serve them. Co-authored-by: Cursor <cursoragent@cursor.com>
tomk-amd
reviewed
Sep 2, 2026
tomk-amd
approved these changes
Sep 2, 2026
tomk-amd
approved these changes
Sep 3, 2026
Member
drchen-amd
added a commit
that referenced
this pull request
Sep 15, 2026
…orm (#1052) Enabling ImGui docking + multi-viewport (#791) made the X11 platform hint conditional on ROCPROFVIS_MULTI_WINDOW, which defaults to OFF, so release builds stopped requesting X11 and GLFW began auto-selecting its Wayland backend on Linux. That backend can only decorate a window if it loads libdecor at runtime or the compositor implements zxdg_decoration_manager_v1. GNOME provides neither, so GLFW falls back to a blank 24px caption with no title and no minimize/maximize/close buttons. The same backend switch also broke setting the window icon and reading the window position, both of which logged GLFW error 65548 on every startup. The hint was never only about multi-viewport, so gate it on __linux__ again as it was before #791. src/app/test/test_main.cpp was left unchanged by that PR and still forces X11 unconditionally, so this also realigns the app with its own test harness. Co-authored-by: drchen <drchen@amd.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


